package com.lanyou.esb.cook.proxy.dao.impl;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import org.springframework.jdbc.core.RowMapper;

import com.lanyou.esb.cook.proxy.entity.ParamSet;

/**
 * 参数设置持久层
 * 
 * @author Davey.wu
 */
public class ParamSetDao extends BaseDao<ParamSet> {

	private RowMapper<ParamSet> mapper = new RowMapper<ParamSet>() {
		public ParamSet mapRow(ResultSet rs, int rowNum) throws SQLException {

			ParamSet rcd = new ParamSet();
			rcd.setId(rs.getString("COOK_BU_PARAM_SET_ID"));
			rcd.setName(rs.getString("PARAM_NAME"));
			rcd.setValue(rs.getString("PARAM_VALUE"));
			rcd.setRemark(rs.getString("REMARK"));

			return rcd;
		}
	};

	@Override
	public List<ParamSet> findAll() {
		String sql = "select * from t_cook_bu_param_set";
		List<ParamSet> records = this.getJdbcTemplate().query(sql, mapper);
		return records;
	}

	

}
